Previous Book Contents Next

Inside Macintosh: What's New in ColorSync 2.5 /


Changes to System Profile and Monitor Profile Operations

With version 2.5, ColorSync has removed certain system profile and monitor profile restrictions. A little history can help explain these restrictions and the new, more flexible approach.

Prior to version 2.5, ColorSync provided the ColorSyncTM System Profile control panel. With that panel, a user could only select an RGB profile for the system profile. The system profile was used for the default display profile, as well as for operations on RGB images that resulted in the need for a default profile (such as when the image itself did not specify a profile). So the system profile was used for two dissimilar functions, which led to several limitations:

More Robust User Interface

With version 2.5, the ColorSync control panel replaces the ColorSyncTM System Profile control panel. The ColorSync panel, with its default settings, is shown in The ColorSync control panel . The new panel lets the user specify profiles for the system profile (for backward compatibility), as well as for RGB and CMYK color spaces. As a result, the link between the system profile and the default profile for the RGB color space is broken, and a user can specify separate default profiles for different color spaces. ColorSync also provides functions your code can use to set default profiles, including profiles for Lab and XYZ spaces. These functions are shown in Default Color Space and System Profile Functions .

With version 2.5, a user can now use the Monitors & Sound control panel to specify a profile for each monitor. ColorSync also provides functions your code can use to specify a profile for each monitor. These functions are shown in Monitor Profile Functions .

Default Color Space and System Profile Functions

ColorSync provides the following functions your code can call to get and set default profiles for RGB, CMYK, Lab, and XYZ color spaces, and to get and set the system profile. For example, if your application doesn't want to present a user interface for setting these profiles, you can use these calls.

CMSetSystemProfile

Sets the system profile.

pascal  CMError  CMSetSystemProfile (
                        const FSSpec * profileFileSpec);

FSSpec A pointer to a file specification structure. Before calling CMSetSystemProfile, set the structure to specify the desired system profile.

function result A result code of type CMError . See Advanced Color Imaging on the Mac OS for a list of ColorSync-specific result codes.

CMGetSystemProfile

Gets the system profile.


 
pascal  CMError  CMGetSystemProfile (
                        CMProfileRef * prof);

prof A pointer to a structure of type CMProfileRef. On return, a reference to the current system profile.

function result A result code of type CMError . See Advanced Color Imaging on the Mac OS for a list of ColorSync-specific result codes.

CMSetDefaultProfileBySpace

Sets the default profile for a color space.


 
pascal  CMError  CMSetDefaultProfileBySpace (
                       OSType dataColorSpace,
                       CMProfileRef prof);

dataColorSpace Specifies the color space for which to set the default profile. You specify one of the currently-supported values, cmRGBData, cmCMYKData,cmLabData, or cmXYZData .

prof A profile reference. Before calling CMSetDefaultProfileBySpace , set the reference to specify the default profile for the color space.

function result A result code of type CMError. See Advanced Color Imaging on the Mac OS for a list of ColorSync-specific result codes.

CMGetDefaultProfileBySpace

Gets the default profile for a color space.


 
pascal CMError CMGetDefaultProfileBySpace(
                     OSType dataColorSpace,
                     CMProfileRef * prof);

dataColorSpace Specifies the color space for which to set the default profile. You specify one of the currently-supported values, cmRGBData, cmCMYKData,cmLabData, or cmXYZData .

prof A pointer to a profile reference. On return, the reference specifies the current profile for the color space specified by dataColorSpace.

function result A result code of type CMError. See Advanced Color Imaging on the Mac OS for a list of ColorSync-specific result codes.

Monitor Profile Functions

ColorSync provides the following functions your code can call to get and set the profile for each monitor. These routines work with the AVIDType data type, which is defined by the Display Manager and used to specify a device such as a monitor.

CMSetProfileByAVID

Sets the profile for a monitor. If the profile contains an optional profile tag for video card gamma, ColorSync will extract the tag from the profile and set the video card based on the tag, as described in Video Card Gamma .

pascal CMError CMSetProfileByAVID (
                          AVIDType  theAVID,
                          CMProfileRef  prof);
theAVID A Display Manager ID value. You pass the ID value for the monitor for which to set the profile.

prof A profile reference. Before calling CMSetProfileByAVID , set the reference to specify the profile for the monitor specified by theAVID .

function result A result code of type CMError.See Advanced Color Imaging on the Mac OS for a list of ColorSync-specific result codes.

CMGetProfileByAVID

Gets the current profile for a monitor.

pascal CMError CMGetProfileByAVID (
                          AVIDType  theAVID,
                          CMProfileRef  *prof);

theAVID A Display Manager ID value. You pass the ID value for the monitor for which to get the profile.

prof A pointer to a profile reference. On return, a reference to the current profile for the monitor specified by theAVID .

function result A result code of type CMError. See Advanced Color Imaging on the Mac OS for a list of ColorSync-specific result codes.

Previous Book Contents Next